<?php

class It_Model_Items extends Zend_Db_Table_Abstract
{
    protected $_name = 'items';
    public function getDataByEquipmentId($equipmentId, $field)
    {
		$select = $this->select();
   		$select->from(array('i'=>'items'), $field)
   				->where('equipmentId = ?', $equipmentId);

   		return $this->fetchAll($select);
    }
    public function getItems($equipmentId)
    {
		$select = $this->select();
   		$select->from(array('i'=>'items'))
   				->where('equipmentId = ?', $equipmentId);

   		return $this->fetchAll($select);
    }
	public function getOwner()
	{
		$select = $this->select()
                        ->from($this->_name, array('owner'))
                        ->where('owner != ?','')
                        ->group('owner')
                        ->order('owner ASC');
		return $this->fetchAll($select);
	}
    public function deleteItemByEquipment ($equipmentId)
    {
    	$this->delete( 'equipmentId =' . (int) $equipmentId );
    }
    
    //chua su dung

	

}

























